package com.modernyuanshiren;

import java.util.List;

public abstract class AbstractGame<T extends AbstractStatus<T, U>, U extends ISingleAction<T, U>> {
	private T initStatus;

	public AbstractGame(Class<T> clazz) {
		super();
		try {
			initStatus = clazz.newInstance();
		} catch (InstantiationException | IllegalAccessException e) {
			e.printStackTrace();
		}
	}

	public void start() {
		initStatus.setElements(getInitElements());
		Resolver<T, U> resolver = new Resolver<>(initStatus);
		resolver.resolve();
	}

	protected abstract List<IElement> getInitElements();
}
